//
//  InfoOverviewController.m
//  cocoapodText
//
//  Created by apple on 16/9/7.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "ShiPei.h"
#import "InfoOverviewController.h"
#import <Foundation/Foundation.h>
@interface InfoOverviewController ()<GYInfoOverviewViewDelegate,ApiInfoOverviewDelegate>
@property(nonatomic,retain) NSMutableArray *orgNoArray;
@end

@implementation InfoOverviewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view setBackgroundColor:FUIColorFromRGB(0xf4f4f4)];
    [self GetMainContentView];
    
}


/**
 * 边界
 * top:(0, 0, kScreenW, 10)
 * bottom:(0, kScreenH-10, kScreenW,10)
 * left:(0, 0, 10, kScreenH)
 * right:(kScreenW-170, 0, 10, kScreenH)
 */
-(void)GetMainContentView{
    //内容栏
    _infoOverview=[[InfoOverviewView alloc]initWithFrame:CGRectMake(0, 0, [ShiPei CGFloatMakeScale:TabChildContentW+35], kScreenH-CommonBarH-kStatusH-[ShiPei CGFloatMakeScale:FSCommonBottomH])];
    [_infoOverview setDelegate:self];
    [self.view addSubview:_infoOverview];
}

-(void)initOverviewInfo{
    APIInfoOverview *manager=[APIInfoOverview alloc];
    [manager setDelegate:self];
    [manager fsgy_api_info_overview_withOrgid:@"520100000" requestCode:IObsjbxxDate];
    [manager fsgy_api_info_overview_withFlag:@"01" requestCode:IObnjnxg];
    [manager fsgy_api_info_overview_withFlag:@"01" requestCode:IOdqynqk];
    [manager fsgy_api_info_overview_withFlag:@"01" requestCode:IOynFx];
    [manager fsgy_api_info_overview_withFlag:@"01" requestCode:IOynde];
}

//点击地图标注
-(void)onSwitchMapORG:(InfoOverviewView *)infoOverviewView orgId:(NSString *)orgId orgName:(NSString *)orgName{
    [_infoOverview.mapMenu.ItemAreaLabel setText:orgName];
    APIInfoOverview *manager=[APIInfoOverview alloc];
    [manager setDelegate:self];
    [manager fsgy_api_info_overview_withOrgid:orgId requestCode:IOmapMessage];
}
//网络访问数据返回处理
-(void)onInfoOverview:(APIInfoOverview *)manager result:(NSDictionary *)result flag:(NSString *)flag Orgid:(NSString *)orgid requestCode:(NSString *)code{
    if ([code isEqualToString:IObsjbxxDate]) {
        //市基本信息
        NSDictionary *bsjbxxDate=[result objectForKey:@"bsjbxxDate"];
        [self onSetOverviewCardData:_infoOverview BaseInfo:bsjbxxDate];
        //地图数据
        NSDictionary *mapMessage=[result objectForKey:@"areaMessage"];
        [self onSetGYMapData:_infoOverview BaseInfo:mapMessage];
    }else if ([code isEqualToString:IObnjnxg]) {
        //本年节能效果
        NSDictionary *bnjnxg=[result objectForKey:@"bnjnxg"];
        [self onSetSavingCardData:_infoOverview BaseInfo:bnjnxg];
        
    }else if ([code isEqualToString:IOdqynqk]) {
        //当前用能情况
        NSDictionary *dqynqk=[result objectForKey:@"dqynqk"];
        [self onSetCurrentEnergyData:_infoOverview BaseInfo:dqynqk Type:flag];
    }else if ([code isEqualToString:IOmapMessage]) {
        //地图数据
        NSDictionary *mapMessage=[result objectForKey:@"areaMessage"];
        [self onSetMapData:_infoOverview BaseInfo:mapMessage];
    }else if ([code isEqualToString:IOynFx]) {
        //用能分享分析（扇形）
        NSDictionary *ynFx=[result objectForKey:@"ynFx"];
        [self onSetShareAnalysisData:_infoOverview BaseInfo:ynFx];
        //flag(电：01，水：02 气：03 冷： 05)
    }else if ([code isEqualToString:IOynde]) {
        //用能定额完成率
        NSDictionary *ynde=[result objectForKey:@"ynde"];
        [self onSetCompletionRateData:_infoOverview BaseInfo:ynde Flag:flag];
        //flag(电：01，水：02 气：03 冷： 05)
    }
}

//设置概览信息数据
-(void)onSetOverviewCardData:(InfoOverviewView *)infoOverviewView BaseInfo:(NSDictionary *)data{
    //区县数量
    NSString *qxmessage=[CommonTool getStringFromNSDictionary:data key:@"qxmessage" defaultValue:@"0"];
    //企业数量
    NSString *qymessage=[CommonTool getStringFromNSDictionary:data key:@"qymessage" defaultValue:@"0"];
    //实时监测企业数量
    NSString *zxqlmessage=[CommonTool getStringFromNSDictionary:data key:@"zxqlmessage" defaultValue:@"0"];
    //昨日能耗
    NSString *daynhmessage=[CommonTool getStringFromNSDictionary:[data objectForKey:@"daynhmessage"] key:@"val" defaultValue:@"0"];
    //本月能耗
    NSString *monthnhmessage=[CommonTool getStringFromNSDictionary:[data objectForKey:@"monthnhmessage"] key:@"val" defaultValue:@"0"];
    //本年能耗
    NSString *yearnhmessage=[CommonTool getStringFromNSDictionary:[data objectForKey:@"yearnhmessage"] key:@"val" defaultValue:@"0"];
    
    CGFloat monthnhmessageNum=[monthnhmessage floatValue];
    CGFloat yearnhmessageNum=[yearnhmessage floatValue];
    NSString *allYearMessage=[NSString stringWithFormat:@"%f",(monthnhmessageNum+yearnhmessageNum)];
    allYearMessage=[CommonTool keepDecimal:allYearMessage];
    [infoOverviewView.overviewCardView1 setCardNumberLabel:qxmessage];
    [infoOverviewView.overviewCardView1 setCardUnitLabel:@"个"];
    [infoOverviewView.overviewCardView2 setCardNumberLabel:qymessage];
    [infoOverviewView.overviewCardView2 setCardUnitLabel:@"家"];
    [infoOverviewView.overviewCardView3 setCardNumberLabel:zxqlmessage];
    [infoOverviewView.overviewCardView3 setCardUnitLabel:@"家"];
    [infoOverviewView.overviewCardView4 setCardNumberLabel:daynhmessage];
    [infoOverviewView.overviewCardView4 setCardUnitLabel:@"tce"];
    [infoOverviewView.overviewCardView5 setCardNumberLabel:monthnhmessage];
    [infoOverviewView.overviewCardView5 setCardUnitLabel:@"tce"];
    [infoOverviewView.overviewCardView6 setCardNumberLabel:allYearMessage];
    [infoOverviewView.overviewCardView6 setCardUnitLabel:@"tce"];
}

-(void)onSetSavingCardData:(InfoOverviewView *)infoOverviewView BaseInfo:(NSDictionary *)data{
    //jnjpxm：节能项目数量  jnl：节能量  jpl：减排量
    NSString *jnjpxm=[CommonTool getStringFromNSDictionary:data key:@"jnjpxm" defaultValue:@"0"];
    NSString *jnl=[CommonTool getStringFromNSDictionary:data key:@"jnl" defaultValue:@"0"];
    NSString *jpl=[CommonTool getStringFromNSDictionary:data key:@"jpl" defaultValue:@"0"];
    //hbzf:环保增幅(ydzf:月度环保增幅 byval:环保增幅 syval:环保增幅)
    NSDictionary *hbzf=[data objectForKey:@"hbzf"];
    NSString *ydzf=[CommonTool getStringFromNSDictionary:hbzf key:@"ydzf" defaultValue:@"0"];
    
    [infoOverviewView.energySavingCardView1 setCardNumberLabel:jnjpxm];
    [infoOverviewView.energySavingCardView1 setCardUnitLabel:@"个"];
    [infoOverviewView.energySavingCardView2 setCardNumberLabel:jnl];
    [infoOverviewView.energySavingCardView2 setCardUnitLabel:@"tce"];
    [infoOverviewView.energySavingCardView3 setCardNumberLabel:jpl];
    [infoOverviewView.energySavingCardView3 setCardUnitLabel:@"t"];
    [infoOverviewView.energySavingCardView4 setCardNumberLabel:ydzf];
    [infoOverviewView.energySavingCardView4 setCardUnitLabel:@"%"];
}

-(void)onSetCurrentEnergyData:(InfoOverviewView *)infoOverviewView BaseInfo:(NSDictionary *)data Type:(NSString *)type{
    //nlj：年累计取val值  年同比：nljTb
    //ylj：月累计取val值   yljTb：月同比  yljHb：月环比
    //rlj：昨日累计        trljTb：同比   trljHb：环比
    NSString *nlj=[CommonTool getStringFromNSDictionary:[data objectForKey:@"nlj"] key:@"val" defaultValue:@"0"];
    NSString *ylj=[CommonTool getStringFromNSDictionary:[data objectForKey:@"ylj"] key:@"val" defaultValue:@"0"];
    NSString *rlj=[CommonTool getStringFromNSDictionary:[data objectForKey:@"rlj"] key:@"val" defaultValue:@"0"];
    NSString *trljTb=[CommonTool getStringFromNSDictionary:data key:@"trljTb" defaultValue:@"0"];
    NSString *trljHb=[CommonTool getStringFromNSDictionary:data key:@"trljHb" defaultValue:@"0"];
    NSString *yljTb=[CommonTool getStringFromNSDictionary:data key:@"yljTb" defaultValue:@"0"];
    NSString *yljHb=[CommonTool getStringFromNSDictionary:data key:@"yljHb" defaultValue:@"0"];
    NSString *nljTb=[CommonTool getStringFromNSDictionary:data key:@"nljTb" defaultValue:@"0"];
    
    NSString *trljTbStatus=@"1";
    NSString *trljHbStatus=@"1";
    NSString *yljTbStatus=@"1";
    NSString *yljHbStatus=@"1";
    NSString *nljTbStatus=@"1";
    NSString *nljHbStatus=@"1";
    
    if (![trljTb isEqualToString:@"--"]) {
        CGFloat trljTbNum=[trljTb floatValue]*100;
        if (trljTbNum>0||trljTbNum==0) {
            trljTbStatus=@"1";
            trljTb=[@"上升" stringByAppendingString:[[CommonTool keepDecimal:[NSString stringWithFormat:@"%f",trljTbNum]] stringByAppendingString:@"%"]];
        }else{
            trljTbStatus=@"0";
            trljTb=[@"下降" stringByAppendingString:[[CommonTool keepDecimal:[NSString stringWithFormat:@"%f",-trljTbNum]] stringByAppendingString:@"%"]];
        }
    }
    
    if (![trljHb isEqualToString:@"--"]) {
        CGFloat trljHbNum=[trljHb floatValue]*100;
        if (trljHbNum>0||trljHbNum==0) {
            trljHbStatus=@"1";
            trljHb=[@"上升" stringByAppendingString:[[CommonTool keepDecimal:[NSString stringWithFormat:@"%f",trljHbNum]] stringByAppendingString:@"%"]];
        }else{
            trljHbStatus=@"0";
            trljHb=[@"下降" stringByAppendingString:[[CommonTool keepDecimal:[NSString stringWithFormat:@"%f",-trljHbNum]] stringByAppendingString:@"%"]];
        }
    }
    
    if (![yljTb isEqualToString:@"--"]) {
        CGFloat yljTbNum=[yljTb floatValue]*100;
        if (yljTbNum>0||yljTbNum==0) {
            yljTbStatus=@"1";
            yljTb=[@"上升" stringByAppendingString:[[CommonTool keepDecimal:[NSString stringWithFormat:@"%f",yljTbNum]] stringByAppendingString:@"%"]];
        }else{
            yljTbStatus=@"0";
            yljTb=[@"下降" stringByAppendingString:[[CommonTool keepDecimal:[NSString stringWithFormat:@"%f",-yljTbNum]] stringByAppendingString:@"%"]];
        }
    }
    
    if (![yljHb isEqualToString:@"--"]) {
        CGFloat yljHbNum=[yljHb floatValue]*100;
        if (yljHbNum>0||yljHbNum==0) {
            yljHbStatus=@"1";
            yljHb=[@"上升" stringByAppendingString:[[CommonTool keepDecimal:[NSString stringWithFormat:@"%f",yljHbNum]] stringByAppendingString:@"%"]];
        }else{
            yljHbStatus=@"0";
            yljHb=[@"下降" stringByAppendingString:[[CommonTool keepDecimal:[NSString stringWithFormat:@"%f",-yljHbNum]] stringByAppendingString:@"%"]];
        }
    }
    
    if (![nljTb isEqualToString:@"--"]) {
        CGFloat nljTbNum=[nljTb floatValue]*100;
        if (nljTbNum>0||nljTbNum==0) {
            nljTbStatus=@"1";
            nljTb=[@"上升" stringByAppendingString:[[CommonTool keepDecimal:[NSString stringWithFormat:@"%f",nljTbNum]] stringByAppendingString:@"%"]];
        }else{
            nljTbStatus=@"0";
            nljTb=[@"下降" stringByAppendingString:[[CommonTool keepDecimal:[NSString stringWithFormat:@"%f",-nljTbNum]] stringByAppendingString:@"%"]];
        }
    }
    
    [infoOverviewView.yearOnYearAndLinkRelativeView1 setNumber:rlj];
    [infoOverviewView.yearOnYearAndLinkRelativeView2 setNumber:ylj];
    [infoOverviewView.yearOnYearAndLinkRelativeView3 setNumber:nlj];
    //flag(电：01，水：02 气：03 冷： 05)
    if ([type isEqualToString:@"01"]) {
        [infoOverviewView.yearOnYearAndLinkRelativeView1 setUnit:@"kWh"];
        [infoOverviewView.yearOnYearAndLinkRelativeView2 setUnit:@"kWh"];
        [infoOverviewView.yearOnYearAndLinkRelativeView3 setUnit:@"kWh"];
    }else if ([type isEqualToString:@"02"]) {
        [infoOverviewView.yearOnYearAndLinkRelativeView1 setUnit:@"m³"];
        [infoOverviewView.yearOnYearAndLinkRelativeView2 setUnit:@"m³"];
        [infoOverviewView.yearOnYearAndLinkRelativeView3 setUnit:@"m³"];
        
    }else if ([type isEqualToString:@"03"]) {
        [infoOverviewView.yearOnYearAndLinkRelativeView1 setUnit:@"m³"];
        [infoOverviewView.yearOnYearAndLinkRelativeView2 setUnit:@"m³"];
        [infoOverviewView.yearOnYearAndLinkRelativeView3 setUnit:@"m³"];
        
    }else if ([type isEqualToString:@"05"]) {
        [infoOverviewView.yearOnYearAndLinkRelativeView1 setUnit:@"GJ"];
        [infoOverviewView.yearOnYearAndLinkRelativeView2 setUnit:@"GJ"];
        [infoOverviewView.yearOnYearAndLinkRelativeView3 setUnit:@"GJ"];
        
    }
    
    [infoOverviewView.yearOnYearAndLinkRelativeView1 setYearOnYear:trljHb status:trljHbStatus];
    [infoOverviewView.yearOnYearAndLinkRelativeView1 setLinkRelative:trljTb status:trljTbStatus];
    
    [infoOverviewView.yearOnYearAndLinkRelativeView2 setYearOnYear:yljHb status:yljHbStatus];
    [infoOverviewView.yearOnYearAndLinkRelativeView2 setLinkRelative:yljTb status:yljTbStatus];
    
    [infoOverviewView.yearOnYearAndLinkRelativeView3 setYearOnYear:@"--" status:nljHbStatus];
    [infoOverviewView.yearOnYearAndLinkRelativeView3 setLinkRelative:nljTb status:nljTbStatus];
}

//点击地图图标响应事件
-(void)onSetMapData:(InfoOverviewView *)infoOverviewView BaseInfo:(NSDictionary *)data{
    //刷新数据
    [_infoOverview refreshOrgNoMapData:data];
}

//初始化地图数据
-(void)onSetGYMapData:(InfoOverviewView *)infoOverviewView BaseInfo:(NSDictionary *)data{
    NSMutableArray *temOrgNoArray=[[NSMutableArray alloc]init];
    //列表（下属地区与单位数据）
    if ([[data allKeys] containsObject:@"listOrg"]){
        _orgNoArray=[data objectForKey:@"listOrg"];
        for (int i=0; i<[_orgNoArray count]; i++) {
            NSDictionary *mapMarker=[_orgNoArray objectAtIndex:i];
            NSString *xcoordinate=[CommonTool getStringFromNSDictionary:mapMarker key:@"xcoordinate" defaultValue:@"0"];
            NSString *ycoordinate=[CommonTool getStringFromNSDictionary:mapMarker key:@"ycoordinate" defaultValue:@"0"];
            if (![xcoordinate isEqualToString:@""]&&![ycoordinate isEqualToString:@""]) {
                [temOrgNoArray addObject:mapMarker];
            }
        }
    }
    //刷新数据
    [_infoOverview refreshMapData:temOrgNoArray Info:data];
}

-(void)onSetCompletionRateData:(InfoOverviewView *)infoOverviewView BaseInfo:(NSDictionary *)data Flag:(NSString *)flag{
    //xAxis：x轴  seriesDataDosageDem：标准量数据 seriesDataDosage：实际量数据
    NSArray *xAxis=[data objectForKey:@"xAxis"];
    //NSArray *seriesDataCharge=[data objectForKey:@"seriesDataCharge"];
    //NSArray *seriesDataChargeDem=[data objectForKey:@"seriesDataChargeDem"];
    NSArray *seriesDataDosage=[data objectForKey:@"seriesDataDosage"];
    NSArray *seriesDataDosageDem=[data objectForKey:@"seriesDataDosageDem"];
    
    NSMutableArray *xVals = [[NSMutableArray alloc] init];
    for (int i = 0; i < [xAxis count]; i++){
        [xVals addObject:[xAxis objectAtIndex:i]];
    }
    NSMutableArray *yVals = [[NSMutableArray alloc] init];
    NSMutableArray *barColors = [[NSMutableArray alloc] init];
    NSMutableArray *yVals1 = [[NSMutableArray alloc] init];
    NSMutableArray *yVals2 = [[NSMutableArray alloc] init];
    
    for (int i = 0; i < [xAxis count]; i++){
        double val1,val2;
        NSString *temDosage=[CommonTool getStringFromNSArray:seriesDataDosage key:i];
        if ([temDosage isEqualToString:@"--"]||[temDosage isEqualToString:@"-"]) {
            val1=0;
        }else{
            val1 = [temDosage doubleValue];
        }
        [yVals1 addObject:[[BarChartDataEntry alloc] initWithValue:val1 xIndex:i]];
        
        NSString *temDosageDem=[CommonTool getStringFromNSArray:seriesDataDosageDem key:i];
        if ([temDosageDem isEqualToString:@"--"]||[temDosageDem isEqualToString:@"-"]) {
            val2=0;
        }else{
            val2 = [temDosageDem doubleValue];
        }
        [yVals2 addObject:[[BarChartDataEntry alloc] initWithValue:val2 xIndex:i]];
    }
    [yVals addObject:yVals1];
    [yVals addObject:yVals2];
    [barColors addObject:FUIColorFromRGB(0xb7a1e0)];
    [barColors addObject:FUIColorFromRGB(0x55b0f1)];
    
    infoOverviewView.xValsRate=xVals;
    infoOverviewView.yValsRate=yVals;
    infoOverviewView.barColors=barColors;
    
    [infoOverviewView multipleBarChartDataWithFlag:flag];
}

-(void)onSetShareAnalysisData:(InfoOverviewView *)infoOverviewView BaseInfo:(NSDictionary *)data{
    //pieData
    NSArray *pieData=[data objectForKey:@"pieData"];
    //每个区块的数据
    NSMutableArray *yVals = [[NSMutableArray alloc] init];
    NSMutableArray *yValsTrue = [[NSMutableArray alloc] init];
    //每个区块的名称或描述
    NSMutableArray *xVals = [[NSMutableArray alloc] init];
    if ([pieData count]==1) {
        if ([[pieData objectAtIndex:0] isKindOfClass:[NSDictionary class]]) {
            NSDictionary *temPieData=[pieData objectAtIndex:0];
            BarChartDataEntry *entry = [[BarChartDataEntry alloc] initWithValue:100 xIndex:0];
            [yVals addObject:entry];
            NSString *value=[CommonTool getStringFromNSDictionary:temPieData key:@"value" defaultValue:@"0"];
            [yValsTrue addObject:value];
            NSString *title = [CommonTool getStringFromNSDictionary:temPieData key:@"name" defaultValue:@"0"];
            [xVals addObject:title];
        }
    }else{
        bool is_all_zero=YES;
        for (int i = 0; i < [pieData count]; i++) {
            if ([[pieData objectAtIndex:0] isKindOfClass:[NSDictionary class]]) {
                NSDictionary *temPieData=[pieData objectAtIndex:i];
                NSString *value=[CommonTool getStringFromNSDictionary:temPieData key:@"value" defaultValue:@"0"];
                [yValsTrue addObject:value];
                double randomVal = [value doubleValue];
                if (randomVal!=0) {
                    is_all_zero=NO;
                }
                BarChartDataEntry *entry = [[BarChartDataEntry alloc] initWithValue:randomVal xIndex:i];
                [yVals addObject:entry];
                NSString *title = [CommonTool getStringFromNSDictionary:temPieData key:@"name" defaultValue:@"0"];
                [xVals addObject:title];
            }
        }
        
        if (is_all_zero) {
            for (int i = 0; i < [pieData count]; i++) {
                BarChartDataEntry *entry = [yVals objectAtIndex:i];
                [entry setValue:100];
            }
        }
    }
    
    NSMutableArray *colors = [[NSMutableArray alloc] init];
    [colors addObject:FUIColorFromRGB(0x43d282)];
    [colors addObject:FUIColorFromRGB(0x45c8dc)];
    [colors addObject:FUIColorFromRGB(0xf77d6a)];
    [colors addObject:FUIColorFromRGB(0x9b6ed0)];
    [colors addObject:FUIColorFromRGB(0xf76e82)];
    [colors addObject:FUIColorFromRGB(0x457dd0)];
    [colors addObject:FUIColorFromRGB(0x43c86a)];
    [colors addObject:FUIColorFromRGB(0xf76e82)];
    [colors addObject:FUIColorFromRGB(0x9b7ddc)];
    [colors addObject:FUIColorFromRGB(0xf7c882)];
    [colors addObject:FUIColorFromRGB(0x1f73af)];
    [colors addObject:FUIColorFromRGB(0x59cc9a)];
    [colors addObject:FUIColorFromRGB(0xff3a00)];
    [colors addObject:FUIColorFromRGB(0x1fcc00)];
    [colors addObject:FUIColorFromRGB(0x593aaf)];
    [colors addObject:FUIColorFromRGB(0xff739a)];
    [colors addObject:FUIColorFromRGB(0xffccaf)];
    [colors addObject:FUIColorFromRGB(0x1f3a9a)];
    [colors addObject:FUIColorFromRGB(0x597300)];
    
    infoOverviewView.xValsWarnPie=xVals;
    infoOverviewView.yValsWarnPie=yVals;
    infoOverviewView.yValsTrueWarnPie=yValsTrue;
    infoOverviewView.pieColors=colors;
    [infoOverviewView pieChartData];
}

-(void)viewWillAppear:(BOOL)animated{
    [_infoOverview.mapView viewWillAppear];
    [super viewWillAppear:animated];
}

-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    [self initOverviewInfo];
    [_infoOverview refresh];
}

-(void)viewWillDisappear:(BOOL)animated{
    [_infoOverview.mapView viewWillDisappear];
    //检索对象不用时，置nil
    _infoOverview.searcher.delegate = nil;
    [super viewWillDisappear:animated];
}

-(void)onSetData:(InfoOverviewView *)infoOverviewView{
    //下拉刷新数据
    [self initOverviewInfo];
}

-(void)onSwitchMenuByTabItem:(InfoOverviewView *)infoOverviewView MenuId:(int)menuId destinationTab:(int)end{
    APIInfoOverview *manager=[APIInfoOverview alloc];
    [manager setDelegate:self];
    switch (menuId) {
        case 1:
        {
            //当前用能情况
            switch (end) {
                case 0:
                {
                    [manager fsgy_api_info_overview_withFlag:@"05" requestCode:IOdqynqk];
                }
                    break;
                case 1:
                {
                    [manager fsgy_api_info_overview_withFlag:@"03" requestCode:IOdqynqk];
                }
                    break;
                    
                case 2:
                {
                    [manager fsgy_api_info_overview_withFlag:@"02" requestCode:IOdqynqk];
                }
                    break;
                case 3:
                {
                    [manager fsgy_api_info_overview_withFlag:@"01" requestCode:IOdqynqk];
                }
                    break;
                default:
                    break;
            }
        }
            break;
        case 2:
        {
            //用能定额完成率
            switch (end) {
                case 0:
                {
                    [manager fsgy_api_info_overview_withFlag:@"05" requestCode:IOynde];
                }
                    break;
                case 1:
                {
                    [manager fsgy_api_info_overview_withFlag:@"03" requestCode:IOynde];
                }
                    break;
                    
                case 2:
                {
                    [manager fsgy_api_info_overview_withFlag:@"02" requestCode:IOynde];
                }
                    break;
                case 3:
                {
                    [manager fsgy_api_info_overview_withFlag:@"01" requestCode:IOynde];
                }
                    break;
                default:
                    break;
            }
        }
            break;
        case 3:
        {
            //用能分享分析
            switch (end) {
                case 0:
                {
                    [manager fsgy_api_info_overview_withFlag:@"05" requestCode:IOynFx];
                }
                    break;
                case 1:
                {
                    [manager fsgy_api_info_overview_withFlag:@"03" requestCode:IOynFx];
                }
                    break;
                    
                case 2:
                {
                    [manager fsgy_api_info_overview_withFlag:@"02" requestCode:IOynFx];
                }
                    break;
                case 3:
                {
                    [manager fsgy_api_info_overview_withFlag:@"01" requestCode:IOynFx];
                }
                    break;
                default:
                    break;
            }
        }
            break;
        default:
            break;
    }
}

@end
